
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart';
import 'package:xin_nuo_pda/base/BaseController.dart';
import 'package:xin_nuo_pda/http/api/lot_api.dart';

class BindPartController extends BaseController{
  String lotID = '';
  String lotID2 = '';

  bindPart() async {
    if(lotID.isEmpty || lotID2.isEmpty){
       Get.snackbar('提示','请扫描成品批次ID或半成品批次ID');
       return;
    }
    Map<String, dynamic> params = {'FINISHEDLOTID':lotID,'SEMIFINISHEDLOTID':lotID2};
    var result = await LotApi.bindPart(canelToken,params: params);
    if(result.ok){
      Fluttertoast.showToast(
        msg: "半成品绑定成功",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIosWeb: 1,
      );

      Get.back();
    }
  }
}